package com.ntschy.taizhou.threaddemo;

import org.springframework.beans.BeanUtils;

import java.util.UUID;

// 复制时，如果源和目标的类型不一致，不会复制。
public class BeanCopyTest {

    public static void main(String[] args) {
        BeanCopyTest beanCopyTest = new BeanCopyTest();
        beanCopyTest.tett();
    }

    private void tett(){
        Student student = new Student(UUID.randomUUID().toString(), "zhangsan", "19");
        Teacher teacher = new Teacher();
        System.out.println(student.toString());
        BeanUtils.copyProperties(student,teacher);
        System.out.println(teacher.toString());
    }

}
